package cn.edu.wfit.modules.infomanagement.service.impl;

import java.util.List;
import cn.edu.wfit.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.edu.wfit.modules.infomanagement.mapper.DormMapper;
import cn.edu.wfit.modules.infomanagement.domain.Dorm;
import cn.edu.wfit.modules.infomanagement.service.IDormService;

/**
 * 宿舍维护Service业务层处理
 * 
 * @author 韩强
 * @date 2024-11-19
 */
@Service
public class DormServiceImpl implements IDormService 
{
    @Autowired
    private DormMapper dormMapper;

    /**
     * 查询宿舍维护
     * 
     * @param dormId 宿舍维护主键
     * @return 宿舍维护
     */
    @Override
    public Dorm selectDormByDormId(Long dormId)
    {
        return dormMapper.selectDormByDormId(dormId);
    }

    /**
     * 查询宿舍维护列表
     * 
     * @param dorm 宿舍维护
     * @return 宿舍维护
     */
    @Override
    public List<Dorm> selectDormList(Dorm dorm)
    {
        return dormMapper.selectDormList(dorm);
    }

    /**
     * 新增宿舍维护
     * 
     * @param dorm 宿舍维护
     * @return 结果
     */
    @Override
    public int insertDorm(Dorm dorm)
    {
        dorm.setCreateTime(DateUtils.getNowDate());
        return dormMapper.insertDorm(dorm);
    }

    /**
     * 修改宿舍维护
     * 
     * @param dorm 宿舍维护
     * @return 结果
     */
    @Override
    public int updateDorm(Dorm dorm)
    {
        dorm.setUpdateTime(DateUtils.getNowDate());
        return dormMapper.updateDorm(dorm);
    }

    /**
     * 批量删除宿舍维护
     * 
     * @param dormIds 需要删除的宿舍维护主键
     * @return 结果
     */
    @Override
    public int deleteDormByDormIds(Long[] dormIds)
    {
        return dormMapper.deleteDormByDormIds(dormIds);
    }

    /**
     * 删除宿舍维护信息
     * 
     * @param dormId 宿舍维护主键
     * @return 结果
     */
    @Override
    public int deleteDormByDormId(Long dormId)
    {
        return dormMapper.deleteDormByDormId(dormId);
    }
}
